-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JNI code for ed25519-zebra #37
Conversation
137c57b
to
4183cc7
Compare
Add some code allowing other languages, via JNI, to interact with ed25519-zebra. The initial commit: - Allows users to obtain a random 32 byte signing key seed. - Allows users to obtain a 32 byte verification key from a signing key seed. - Allows users to sign arbitrary data. - Allows users to verify an Ed25519 signature. - Includes a Java file that can be used. - Includes some Scala-based JNI tests.
- Minor Rust code optimizations. - Rust build optimizations. - Tweak the JNI JAR prereq script to match the new outputs.
@yaahc - Folded in your requested changes. The build system might not be fully optimized, though. I noticed that Thanks. |
@yaahc - Pushed some more build system changes. They partially undid your requested changes, such as removing the workspace. If you think it's worthwhile to put that back, I'm happy to discuss it. Things are fine on my end but I don't mind moving things around if they'll improve things or fit standard Rust patterns. |
- More build system tidying. The primary goal is to try to firewall the JNI code from everything else. - README tidying.
- Clean up the wrapper classes (streamlining, make constructors private, more mutability safety). - private -> public for a static variable intended for public usage. - Minor comment & build system cleanup.
Decided to bump the version to reflect earlier changes.
oh, so you removed the workspace but didn't add back the |
@yaahc - I'm a little confused. I was under the impression that .cargo/config wasn't necessary. It also seemed to be messing with the path within the target directory. Regarding why it was added in the first place, it's a bit of cruft. At first, the Java and the Rust code were basically sitting on top of each other. The config file got added in order to have a place where target files could go. Once everything got separated and worked out on my end, the file didn't seem to be necessary anymore. If it's causing CI problems, I can definitely reassess. |
Also add "-JNI" to assist with tagging and otherwise distinguish the JNI code from the main library version/code.
Oh, you're right, it isn't necessary. I thought you'd used it to deduplicate the
👍 |
Also add a test suite for VerificationKeyBytes.
- Fix hashCode() override. - Add a test. - Remove unneecessary semicolons.
Mirror the Signature struct from Rust and add some basic tests. Also do a bit of Scala test cleanup.
@yaahc - Okay, I think we're finally golden. :) The last 2-3 commits should be all that you need to review but I understand if you want to review the whole thing again. My apologies for always adding stuff. This should be it for awhile. |
Add some code allowing other languages, via JNI, to interact with ed25519-zebra. The initial commit: